<?php 
$this->layout = '//layouts/admin/ad';
$this->pageTitle = $model->isNewRecord ? '添加新广告' : '编辑广告' . '【'.$model->ad_title.'】';
?>
<style>
.tagsinput input {
    width:100px;
}
.select .btn{
    padding:3px;
}
.select .btn .filter-option{
    top:3px;
}
</style>
<div class="container container-admin">
    <div class='row'>
        <div class="span3">
            <?php $this->beginWidget('AdminLeftNavWidget');$this->endWidget();?>
        </div>
        <div class='span9'>
            <div class='page-header' style='width:106%'>
                <h2>
                    <span class='fui-new'></span>
                    <?php echo $model->isNewRecord ? '添加新广告' : '编辑广告信息'?>
                    <small>
                        <a href='#'>
                            <?php echo $model->isNewRecord ? '' : '查看广告'?>
                        </a>
                    </small>
                </h2>
            </div>
            <div class="row">
                
                    <?php $form=$this->beginWidget('CActiveForm', array(
                        'id'=>'ad-form',
                        'enableAjaxValidation'=>true,
                        'htmlOptions'=>array(
                            'class'=>'form-horizontal',
                        )
                    )); ?>
                    <?php echo $form->hiddenField($model,'user_id',array('value'=>Yii::app()->admin->id, 'class'=>'')); ?>
                    <div class='span7 left'>
                        <div class="control-group">
                            <?php echo $form->labelEx($model,'ad_title',array('class'=>'')); ?>
                            <div class="">
                                <?php echo $form->textField($model,'ad_title',array('size'=>60,'maxlength'=>255,'class'=>'span7', 'style'=>'padding:5px', 'placeholder'=>'输入广告标题')); ?>
                                <?php echo $form->error($model,'ad_title',array('class'=>'alert')); ?>
                            </div>
                        </div>
                        
                        <div class="control-group">
                            <?php echo $form->labelEx($model,'ad_url',array('class'=>'')); ?>
                            <div class="">
                                <?php echo $form->textField($model,'ad_url',array('size'=>60,'maxlength'=>255,'class'=>'span7', 'style'=>'padding:5px', 'placeholder'=>'输入广告地址')); ?>
                                <?php echo $form->error($model,'ad_url',array('class'=>'alert')); ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <?php echo $form->labelEx($model,'img_title',array('class'=>'')); ?>
                            <div class="">
                                <?php echo $form->textField($model,'img_title',array('size'=>60,'maxlength'=>255,'class'=>'span7', 'style'=>'padding:5px', 'placeholder'=>'输入图片标题')); ?>
                                <?php echo $form->error($model,'img_title',array('class'=>'alert')); ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <?php echo $form->labelEx($model,'img_url',array('class'=>'')); ?>
                            <div class="">
                                <?php echo $form->textField($model,'img_url',array('size'=>60,'maxlength'=>255,'class'=>'span7', 'style'=>'padding:5px', 'placeholder'=>'输入图片地址')); ?>
                                <?php echo $form->error($model,'img_url',array('class'=>'alert')); ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <div class="">
                                <?php echo CHtml::submitButton($model->isNewRecord ? '发布广告' : '更新广告',array('class'=>'btn btn-primary', 'style'=>'padding:5px')); ?>
                            </div>
                        </div>
                    </div>
                    <div class='span2 right'>

                    </div>
                    <?php $this->endWidget();?>
            </div>
        </div>
    </div>
</div>



<!-- 
<div class='container-fluid'>
    <div class='span1'></div>
    <div class='span10'>
    <?php $form=$this->beginWidget('CActiveForm', array(
            'id'=>'blog-form',
            'enableAjaxValidation'=>true,
            'htmlOptions'=>array(
                'class'=>'form-horizontal',
            )
        )); ?>
        <fieldset>
            <div id="legend" class="">
                <legend class=""><?php echo $model->isNewRecord ? '添加广告' : '保存广告'?></legend>
            </div>
            <div class="control-group">
                <?php echo $form->labelEx($model,'ad_title',array('class'=>'')); ?>
                <div class="">
                    <?php echo $form->textField($model,'ad_title',array('size'=>60,'maxlength'=>255,'class'=>'span10')); ?>
                    <?php echo $form->error($model,'ad_title',array('class'=>'alert')); ?>
                </div>
            </div>
            <?php echo $form->hiddenField($model,'user_id',array('value'=>Yii::app()->admin->id, 'class'=>'')); ?>
            <div class="control-group">
                <?php echo $form->labelEx($model,'ad_url',array('class'=>'')); ?>
                <div class="">
                    <?php echo $form->textField($model,'ad_url',array('size'=>60,'maxlength'=>255,'class'=>'span10')); ?>
                    <?php echo $form->error($model,'ad_url',array('class'=>'alert')); ?>
                </div>
            </div>
            <div class="control-group">
                <?php echo $form->labelEx($model,'img_title',array('class'=>'')); ?>
                <div class="">
                    <?php echo $form->textField($model,'img_title',array('size'=>60,'maxlength'=>255,'class'=>'span10')); ?>
                    <?php echo $form->error($model,'img_title',array('class'=>'alert')); ?>
                </div>
            </div>
            <div class="control-group">
                <?php echo $form->labelEx($model,'img_url',array('class'=>'')); ?>
                <div class="">
                    <?php echo $form->textField($model,'img_url',array('size'=>60,'maxlength'=>255,'class'=>'span10')); ?>
                    <?php echo $form->error($model,'img_url',array('class'=>'alert')); ?>
                </div>
            </div>

            <div class="control-group">
                <?php echo $form->labelEx($model,'type_id',array('class'=>'')); ?>
                <div class="">
                    <?php echo $form->dropDownList($model,'type_id',$type); ?>
                    <?php echo $form->error($model,'type_id',array('class'=>'alert')); ?>
                </div>
            </div>
            <div class="control-group">
                <div class="">
                    <?php echo CHtml::submitButton($model->isNewRecord ? '添加广告' : '保存广告',array('class'=>'btn btn-primary')); ?>
                </div>
            </div>

        </fieldset>
        <?php $this->endWidget(); ?>
    </div>
    <div class='span1'></div>
</div> -->
